Repository navigation
Fix Mesh.face_to_vertex_overlay for single-frame overlays - #89
Merged
jnolan14 merged 1 commit intoNov 12, 2026
Merged
Conversation
Scalar overlays are stored with shape (nfaces,), while the accumulation buffer has an explicit frame axis, (nvertices, nframes). With a single-frame overlay the indexed reductions (np.add.at, np.maximum.at, np.minimum.at) cannot broadcast (nfaces,) values onto the (nfaces, 1) selection and raise "array is not broadcastable to correct shape", so face_to_vertex_overlay() failed for every method on 1-D overlays. Reshape the overlay values to (nfaces, nframes) before the reductions. Multi-frame behaviour is unchanged. Adds test/test_mesh_overlay.py, which compares all four reduction methods against a loop-based reference for 1- and 2-frame overlays. Originally committed in the inhuszar/surfa fork as part of 8ef40a9 ("Bugfix: thread limit, overlay accumulation"); supersedes the earlier local workaround 0ba0004 ("NumPy 2.0 bugfix"). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit e0951dc)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scalar overlays are stored with shape (nfaces,), while the accumulation buffer has an explicit frame axis, (nvertices, nframes). With a single-frame overlay the indexed reductions (np.add.at, np.maximum.at, np.minimum.at) cannot broadcast (nfaces,) values onto the (nfaces, 1) selection and raise "array is not broadcastable to correct shape", so face_to_vertex_overlay() failed for every method on 1-D overlays.
Reshape the overlay values to (nfaces, nframes) before the reductions. Multi-frame behaviour is unchanged.
Adds test/test_mesh_overlay.py, which compares all four reduction methods against a loop-based reference for 1- and 2-frame overlays.